package org.gourpg.pages.project;

import org.apache.tapestry5.annotations.InjectPage;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.hibernate.annotations.CommitAfter;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.gourpg.entity.project.ProjectDetail;
import org.gourpg.pages.Index;
import org.hibernate.Session;

public class CreateProject {

    @Property
    private ProjectDetail projectDetail;

    @Inject
    private Session session;

    @InjectPage
    private Index index;

    @CommitAfter
    Object onSuccess() {
        session.persist(projectDetail);

        return index;
    }
}
